<?php
/*
 * name: cxm
 * desc: 用户导入
 * date: 2020/08/11
 * */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateUserImportRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_import_record', function (Blueprint $table) {
            $table->char('uuid',36)->primary();
            $table->string('title')->comment('导入备注标题');
            $table->string('redis_title')->comment('存入redis名称');
            $table->tinyInteger('status')->default(1)->comment('导入状态 1排队中 2处理中 3处理完成');
            $table->timestamps();
        });
        // 表注释
        DB::statement("ALTER TABLE `".config('database.connections.mysql.prefix')."user_import_record` comment'导入记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_import_record');
    }
}
